import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class Colours {
  static const Color appThemeColor    = Color(0xFF20A892);
  static const Color defaultBgColor   = Color(0xFFF4F4F4);
  static const Color defaultBlueColor = Color(0xFF4CA5FF);
}

class Dimens {

  static const double font_sp12 = 12;
  static const double font_sp13 = 13;
  static const double font_sp14 = 14;
  static const double font_sp15 = 15;
  static const double font_sp16 = 16;

  //圆角
  static const double container_corners = 4;

  static const double textField_corners        = 25;
  static const double little_textField_corners = 6;

  //间隔
  static const double gap_dp3  = 3;
  static const double gap_dp5  = 5;
  static const double gap_dp6  = 6;
  static const double gap_dp10 = 10;
  static const double gap_dp12 = 12;
  static const double gap_dp15 = 15;
  static const double gap_dp20 = 20;

  static const double padding_left     = 15;
  static const double padding_left2    = 20;

  static const double padding_right    = 15;
  static const double padding_right2   = 20;

  static const double padding_top      = 15;
  static const double padding_top2     = 20;

  static const double padding_bottom   = 15;
  static const double padding_bottom2  = 20;

}

//间隔
class Gaps {
  //水平间隔
  static Widget hGap6  = new SizedBox(width: Dimens.gap_dp6);
  static Widget hGap10 = new SizedBox(width: Dimens.gap_dp10);
  static Widget hGap12 = new SizedBox(width: Dimens.gap_dp12);
  static Widget hGap15 = new SizedBox(width: Dimens.gap_dp15);
  static Widget hGap20 = new SizedBox(width: Dimens.gap_dp20);
  //垂直间隔
  static Widget vGap3  = new SizedBox(height: Dimens.gap_dp3);
  static Widget vGap6  = new SizedBox(height: Dimens.gap_dp6);
  static Widget vGap10 = new SizedBox(height: Dimens.gap_dp10);
  static Widget vGap12 = new SizedBox(height: Dimens.gap_dp12);
  static Widget vGap15 = new SizedBox(height: Dimens.gap_dp15);
  static Widget vGap20 = new SizedBox(height: Dimens.gap_dp20);

  //滚动垂直间隔
  static Widget hSliverToBoxAdapter(double height){ return SliverToBoxAdapter(child: Container(height: height, ), );}
  static Widget hSliverToBoxAdapter12 = SliverToBoxAdapter(child: Container(height: 12, ), );

}

//按钮样式
class RaisedButtonStyle {

  //圆角样式
  static const ShapeBorder shape = const RoundedRectangleBorder(
      side: BorderSide.none,
      borderRadius: BorderRadius.all(Radius.circular(Dimens.textField_corners))
  );
}

class ContainerBorderStyle {
  //  盒子圆角，自定义颜色，大小
  static BoxDecoration cBorderBoxOnly(double radius, Color color){return BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(radius)),color: color, );}
  static BoxDecoration cBorderWhite4 = BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(4)),color: Colors.white, );
  static BoxDecoration cBorderWhite6 = BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6)),color: Colors.white, );
}

class appStyle {
  //加载设备信息
//  Future _getDeviceInfo() async{
//    DeviceInfoPlugin deviceInfo = new DeviceInfoPlugin();
//    if(Platform.isIOS){
//      print('IOS设备：');
//      return await deviceInfo.iosInfo;
//    }else if(Platform.isAndroid){
//      print('Android设备');
//      return await deviceInfo.androidInfo;
//    }
//  }

}